{% extends 'base.html.twig' %}

{% block body %}
    <h1>Product list</h1>

    <table>
        <thead>
            <tr>
                <th>Id</th>
                <th>Cid</th>
                <th>No</th>
                <th>Name</th>
                <th>Price</th>
                <th>Marketprice</th>
                <th>Stockprice</th>
                <th>Num</th>
                <th>Searchinfo</th>
                <th>Actions</th>
            </tr>
        </thead>
        <tbody>
        {% for product in products %}
            <tr>
                <td><a href="{{ path('product_show', { 'id': product.id }) }}">{{ product.id }}</a></td>
                <td>{{ product.cid }}</td>
                <td>{{ product.no }}</td>
                <td>{{ product.name }}</td>
                <td>{{ product.price }}</td>
                <td>{{ product.marketPrice }}</td>
                <td>{{ product.stockPrice }}</td>
                <td>{{ product.num }}</td>
                <td>{{ product.searchInfo }}</td>
                <td>
                    <ul>
                        <li>
                            <a href="{{ path('product_show', { 'id': product.id }) }}">show</a>
                        </li>
                        <li>
                            <a href="{{ path('product_edit', { 'id': product.id }) }}">edit</a>
                        </li>
                    </ul>
                </td>
            </tr>
        {% endfor %}
        </tbody>
    </table>

    <ul>
        <li>
            <a href="{{ path('product_new') }}">Create a new entry</a>
        </li>
    </ul>
{% endblock %}
